package com.luhuiguo.cms.shared.event;

import com.google.gwt.event.shared.GwtEvent;
import com.luhuiguo.cms.shared.model.ArticleModel;

public class DeleteArticleEvent extends GwtEvent<DeleteArticleEventHandler> {

    public static Type<DeleteArticleEventHandler> TYPE = new Type<DeleteArticleEventHandler>();

    private final ArticleModel article;

    public DeleteArticleEvent(ArticleModel article) {
        this.article = article;
    }

    public ArticleModel getArticle() {
        return article;
    }

    @Override
    public Type<DeleteArticleEventHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(DeleteArticleEventHandler handler) {
        handler.onDeleteArticle(this);
    }

}
